package homework02;

public class StringHandlerDemo {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String s) {
                System.out.println(s);
            }
        });
    //使用lambda表达式简写
        useStringHandler(s -> System.out.println(s));
    }


    public static void useStringHandler(StringHandler stringHandler) {
        stringHandler.printMessage("Lambda");
    }
}
